﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Windows;
using System.Windows.Controls;
using XamlDom.Runtime;

namespace XamlDomTest
{
    [TestClass]
    public class PropertiesRuntimeFixture
    {
        [TestMethod]
        public void TestOrientationPropertyRuntime()
        {
            Orientation orientation = PropertiesRuntime.GetOrientation("Horizontal");

            Assert.AreEqual(orientation, Orientation.Horizontal);
        }

        [TestMethod]
        public void TestMarginOrPaddingPropertyRuntime()
        {
            Thickness margin = PropertiesRuntime.GetMarginOrPadding("30");
            Thickness margin1 = PropertiesRuntime.GetMarginOrPadding("10,10,10,10");
            Thickness margin2 = PropertiesRuntime.GetMarginOrPadding("20,50");

            Assert.AreEqual(30.0, margin.Left);
            Assert.AreEqual(30.0, margin.Bottom);
            Assert.AreEqual(10.0, margin1.Left);
            Assert.AreEqual(20.0, margin2.Left);
            Assert.AreEqual(50.0, margin2.Top);
        }
    }
}
